﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization;
using System.Windows;

namespace MBNet6;
public class VMMB : INotifyPropertyChanged
{

    public event PropertyChangedEventHandler? PropertyChanged;
    private void RaisePropertyChanged([CallerMemberName] string propertyName = "") => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));

    [JsonIgnore]
    [NotMapped]
    public bool CanExecuteCmd { get; set; } = true;
    public VMCommand Cmd { get; set; } = default!;

    private Visibility _VWin = Visibility.Hidden;
    public Visibility VWin
    {
        get => _VWin;
        set
        {
            _VWin = value;
            RaisePropertyChanged();
        }
    }

    private Visibility _VBtn = Visibility.Collapsed;
    public Visibility VBtn
    {
        get => _VBtn;
        set
        {
            _VBtn = value;
            RaisePropertyChanged();
        }
    }

    private string _Message = String.Empty;
    public string Message
    {
        get => _Message;
        set
        {
            _Message = value;
            RaisePropertyChanged();
        }
    }


    private string _IconText = "!";
    public string IconText
    {
        get => _IconText;
        set
        {
            if (_IconText != value)
            {
                _IconText = value;
                RaisePropertyChanged();
            }
        }
    }


    private string _DefaultBtnText = String.Empty;
    public string DefaultBtnText
    {
        get => _DefaultBtnText;
        set
        {
            _DefaultBtnText = value;
            RaisePropertyChanged();
        }
    }

    private int _SecondsDelay;
    public int SecondsDelay
    {
        get => _SecondsDelay;
        set
        {
            _SecondsDelay = value;
            RaisePropertyChanged();
        }
    }

    private ObservableCollection<KeyValuePair<int, string>> _Items = new();
    public ObservableCollection<KeyValuePair<int, string>> Items
    {
        get => _Items;
        set
        {
            _Items = value;
            RaisePropertyChanged();
        }
    }

}
